package com.design.graduation.asdemo.event;


import com.squareup.otto.Bus;

/**
 * Created by lijinyuan on 16/2/17.
 */
public class BusProvider {

    private volatile static Bus bus;

    private static Bus getInstance(){
        if (bus == null){
            synchronized (BusProvider.class){
                bus = new Bus();
            }
        }
        return bus;
    }

    public static void register(Object object){
        getInstance().register(object);
    }

    public static void unregister(Object object){
        getInstance().unregister(object);
    }

    public static void post(Object event){
        getInstance().post(event);
    }
}
